﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageTitle" runat="server">
    <title>易得桌面</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PageStyles" runat="server">
    <link href="../../Content/table_jui.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .tableContainer
        {
            word-break: break-all;
            word-wrap: break-word;
        }
        .attendanceInfod
        {
            width: 80px;
        }
        .expText
        {
            margin-left: 10px;
            width: 50px;
        }
        .tbl tr
        {
            text-align: left;
        }
        .tbl tr td
        {
            text-align: left;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageScripts" runat="server">
    <script src="../../Scripts/jquery.dataTables.js" type="text/javascript"></script>
    <script type="text/javascript">
    //************* URL常量

    var URL_PERSONAL_ATTENDANCE_LIST_PER_MONTH = '/attendance/PersonalAttendanceListPerMonth';
    var URL_SIMPLEUSERINFO_BY_DEPTID = '/core/GetUserInfoInDept'

    //************* 全局变量

    var g_Var = {
        'startYear': null,
        'currentUserId': null,
        'targetTime': null,
        'isHasPermisson': null

    };

    //************* 常量定义

    var StaticResource = {
        'NotAttendance': '未考勤',
        'OnDuty': '上班',
        'OffDuty': '下班'

    };
    var memberSelector = null;


    var AttdendacneTypeResource = {
        'onDuty': StaticResource.OnDuty,
        'offDuty': StaticResource.OffDuty
    };



    var convertor = {
        "正常工作日": function (item) {
            return item.theDayInfo.IsNeedToWork;
        },
        "星期": function (item) {
            var attendanceTime = Date.fromEpoch(item.theDayInfo.Date);
            var attendanceDate = attendanceTime.toFullDate();
            var day = attendanceTime.getDay();
            var attendanceDay = "星期" + "日一二三四五六".charAt(day);
            
            return attendanceDay 
        },
        "日期": function (item) {
            var attendanceTime = Date.fromEpoch(item.theDayInfo.Date);
            var attendanceDate = attendanceTime.toFullDate();
           
            return attendanceDate;
        },
        "考勤记录": function (item) {
            var attendanceInfoList = item.dayAttendanceInfoList;
            var isNeedToWork = item.theDayInfo.IsNeedToWork;
            var attendanceInfoBox = "";
            for(var key in attendanceInfoList){
                var target = attendanceInfoList[key].IsAbnormalAttendance?  "<span class='important'>*</span>" : "<span class='important'>&nbsp</span>";
                var time = Date.fromEpoch(attendanceInfoList[key].ActionTime);
                var explanation = attendanceInfoList[key].Explanation;
                var explanationStr = "";
                var actionTime = "";
                //没有时间
                if(time == null){
                    //需要工作
                    if(isNeedToWork == true){
                        actionTime = "未考勤";
                    }else{
                        actionTime = " --- "
                    }
                }else{
                    actionTime = time.toFullTimeFormat();
                }
                //备注
                if(explanation != null){
                    explanationStr = explanation;   
                }
                
                attendanceInfoStr = '<p><span  class="attendanceInfo">{type}: &nbsp;{target}{actionTime}</span><span class="expText">{explanation}</span></p>';
                attendanceInfoStr = attendanceInfoStr.replace("{type}", AttdendacneTypeResource[attendanceInfoList[key].AttendanceType])
                                                     .replace("{target}", target) 
                                                     .replace("{actionTime}", actionTime)
                                                     .replace("{explanation}", explanationStr);
                attendanceInfoBox = attendanceInfoBox + attendanceInfoStr 
            }

            return attendanceInfoBox;
        },
        "节假日": function (item) {
            //法定节假日信息
            var holidayName = "";
            var extraShiftName = "";
            var dayInfo = item.theDayInfo;
            if (dayInfo && dayInfo.HolidayInfo) {
                holidayName = dayInfo.HolidayInfo.Name;
            }

            if (dayInfo && dayInfo.ExtraShiftInfo) {
                extraShiftName = dayInfo.Name;
            }


            var absenceInfo = "";
            // 请假信息
            var leaveInfo = item.theDayLeaveInfo;
            if (leaveInfo) {
                if (leaveInfo.IsWholeDay) {

                    for (var key in leaveInfo.Leaves) {

                        absenceInfo = leaveInfo.Leaves[key].LeaveName;
                    }


                }
                else {
                    for (var key in leaveInfo.Leaves) {

                        var LeavName = leaveInfo.Leaves[key].LeaveName;


                        var startTime = leaveInfo.Leaves[key].StartTime;
                        var startTimeFormat = Date.fromEpoch(startTime);
                        var sartFullTimeFormat = startTimeFormat.toFullTimeFormat();

                        var endTime = leaveInfo.Leaves[key].EndTime;
                        var endTimeFormat = Date.fromEpoch(endTime);
                        var endFullTimeFormat = endTimeFormat.toFullTimeFormat()

                        absenceInfo += sartFullTimeFormat
                                            + "-"
                                            + endFullTimeFormat
                                            + " "
                                            + LeavName
                                            + "<br \>";
                    }
                }
            }

            absenceInfo += " " + extraShiftName + " " + holidayName;

            return absenceInfo;
        }

    };



    //************* Accessor访问器

    var EzAccessor = {};
    if (ezmock.IS_MOCKED) {
        var mock_startYear = 1999;
        var mock_currentTime = { "CurrentTime": 1281423559 };
        ///部门列表
        var mock_deptList = [
            {
                'Id': '111',
                'DeptName': '软件工程'
            },
            {
                'Id': '222',
                'DeptName': '策划'
            },
            {
                'Id': '333',
                'DeptName': '设计'
            }
            ];
        var mock_currentUser =
            {
                "Id": "22222",
                "Name": "李7",
                "UserName": "yuxin",
                "Dept":
                 {
                     "Id": "333",
                     "DeptName": "设计",
                     "GroupId": "9ad96dac-88d8-4315-bfdb-9931c8f3cb7c"
                 }

            };

        var mock_json = { "AttendanceInfoList":

            [{ "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241107200, "AttendanceType": "onDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": { "Date": "1241107200", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1241107200", "NeedToWork": false, "HolidayInfo": { "Id": "1dd34483-a98f-47cc-8e37-34a45f53c03a", "Name": "劳动节", "Year": 2009, "StartDate": "1241107200", "EndDate": "1241280000", "Remark": null }, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241107200, "AttendanceType": "offDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241193600, "AttendanceType": "onDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": { "Date": "1241193600", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1241193600", "NeedToWork": false, "HolidayInfo": { "Id": "1dd34483-a98f-47cc-8e37-34a45f53c03a", "Name": "劳动节", "Year": 2009, "StartDate": "1241107200", "EndDate": "1241280000", "Remark": null }, "ExtraShiftInfo": null, "IsWeekEnd": true} }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241193600, "AttendanceType": "offDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241280000, "AttendanceType": "onDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": { "Date": "1241280000", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1241280000", "NeedToWork": false, "HolidayInfo": { "Id": "1dd34483-a98f-47cc-8e37-34a45f53c03a", "Name": "劳动节", "Year": 2009, "StartDate": "1241107200", "EndDate": "1241280000", "Remark": null }, "ExtraShiftInfo": null, "IsWeekEnd": true} }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241280000, "AttendanceType": "offDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "9ddb789c-68d0-4a2b-8f6c-360cfafc5727", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241366400, "AttendanceType": "onDuty", "ActionTime": 1241399043, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1241366400", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1241366400", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "577bcf03-92ab-42e7-9738-e5b96ac97c51", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241366400, "AttendanceType": "offDuty", "ActionTime": 1241434359, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "81457ecc-86a4-4315-9701-f9b4d8c99aba", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241452800, "AttendanceType": "onDuty", "ActionTime": 1241485587, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1241452800", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1241452800", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "6a96b1b0-9190-439a-ab30-be89e5583dfe", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241452800, "AttendanceType": "offDuty", "ActionTime": 1241517709, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "a3c28521-95d8-4add-b82f-e561ac4f15c5", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241539200, "AttendanceType": "onDuty", "ActionTime": 1241575051, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1241539200", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1241539200", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "bf489b55-f5b0-48d5-b969-1a2256eb7987", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241539200, "AttendanceType": "offDuty", "ActionTime": 1241604773, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "76faf8bc-5899-432a-9b31-09989e2b5b82", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241625600, "AttendanceType": "onDuty", "ActionTime": 1241658267, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1241625600", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1241625600", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "d90bc521-beed-43c4-8aae-febe0468c048", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241625600, "AttendanceType": "offDuty", "ActionTime": 1241705894, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "d746fb32-cdc6-48bc-b02c-aecddebec14d", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241712000, "AttendanceType": "onDuty", "ActionTime": 1241747729, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1241712000", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1241712000", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "73d52518-1ba2-4e4c-a6cd-5d5fd059ebe6", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241712000, "AttendanceType": "offDuty", "ActionTime": 1241779972, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241798400, "AttendanceType": "onDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": { "Date": "1241798400", "Leaves": [{ "LeaveName": "出差", "LeaveId": "f078071a-a53b-4356-8f64-cdc306599a54", "Day": "1241798400", "StartTime": "1241830800", "EndTime": "1241863200", "IsForWork": false}], "FirstLeave": { "LeaveName": "出差", "LeaveId": "f078071a-a53b-4356-8f64-cdc306599a54", "Day": "1241798400", "StartTime": "1241830800", "EndTime": "1241863200", "IsForWork": false }, "LastLeave": { "LeaveName": "出差", "LeaveId": "f078071a-a53b-4356-8f64-cdc306599a54", "Day": "1241798400", "StartTime": "1241830800", "EndTime": "1241863200", "IsForWork": false }, "IsWholeDay": true }, "DayInfo": { "Date": "1241798400", "NeedToWork": false, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": true} }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241798400, "AttendanceType": "offDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241884800, "AttendanceType": "onDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": { "Date": "1241884800", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1241884800", "NeedToWork": false, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": true} }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241884800, "AttendanceType": "offDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "181f70e9-d09d-4a17-b6ab-943923c39eb7", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241971200, "AttendanceType": "onDuty", "ActionTime": 1242003647, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1241971200", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1241971200", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "68f4db79-ef47-49ff-b243-c3cd57936bf5", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1241971200, "AttendanceType": "offDuty", "ActionTime": 1242037342, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "0373f392-4115-430a-87e2-26fb3d9953b4", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242057600, "AttendanceType": "onDuty", "ActionTime": 1242090055, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1242057600", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1242057600", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "e8f21bc9-020d-4731-86d1-c365a170169d", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242057600, "AttendanceType": "offDuty", "ActionTime": 1242123024, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "43bd0be8-dfd5-430e-8c9f-e32b65c1df56", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242144000, "AttendanceType": "onDuty", "ActionTime": 1242179366, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1242144000", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1242144000", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "2fd32d9c-9a93-458d-91a8-57b91d9cde01", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242144000, "AttendanceType": "offDuty", "ActionTime": 1242210032, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "84edd517-4452-46a8-a0a4-1671cffa50d3", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242230400, "AttendanceType": "onDuty", "ActionTime": 1242262746, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1242230400", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1242230400", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "f0192b33-f6b7-442b-9ee4-e58c0b62e7f9", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242230400, "AttendanceType": "offDuty", "ActionTime": 1242295316, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "11ca894e-ec62-429f-9a5e-8c8868a6d301", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242316800, "AttendanceType": "onDuty", "ActionTime": 1242349036, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1242316800", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1242316800", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "e4ba44cf-619f-40ba-b99e-6aff6dd997c4", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242316800, "AttendanceType": "offDuty", "ActionTime": 1242382143, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242403200, "AttendanceType": "onDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": { "Date": "1242403200", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1242403200", "NeedToWork": false, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": true} }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242403200, "AttendanceType": "offDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242489600, "AttendanceType": "onDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": { "Date": "1242489600", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1242489600", "NeedToWork": false, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": true} }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242489600, "AttendanceType": "offDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "42f22d99-7be6-4b2e-b3a4-48e408055bef", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242576000, "AttendanceType": "onDuty", "ActionTime": 1242608611, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1242576000", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1242576000", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "ffb90195-9472-4843-be13-6c8e2558dc5d", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242576000, "AttendanceType": "offDuty", "ActionTime": 1242641241, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "09365e5a-c38f-4add-bd46-46f736f692e7", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242662400, "AttendanceType": "onDuty", "ActionTime": 1242694471, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1242662400", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1242662400", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "c0a91e57-77e4-4208-a3e5-24dd2e31828d", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242662400, "AttendanceType": "offDuty", "ActionTime": 1242742102, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "e6b282a4-fa0e-49c1-99bf-2fb83faeb860", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242748800, "AttendanceType": "onDuty", "ActionTime": 1242784755, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1242748800", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1242748800", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "6546e5fe-abd0-4621-8b90-244de01e6484", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242748800, "AttendanceType": "offDuty", "ActionTime": 1242814286, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "f025b19f-5da4-4d69-88bb-a32de746db11", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242835200, "AttendanceType": "onDuty", "ActionTime": 1242867528, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1242835200", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1242835200", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "aa4240bd-89a9-4ab2-a0e4-d146055a4485", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242835200, "AttendanceType": "offDuty", "ActionTime": 1242900434, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242921600, "AttendanceType": "onDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1242921600", "Leaves": [{ "LeaveName": "调休", "LeaveId": "1b1bd359-2802-4800-b6e1-52d8bc106ce7", "Day": "1242921600", "StartTime": "1242954000", "EndTime": "1242986400", "IsForWork": false}], "FirstLeave": { "LeaveName": "调休", "LeaveId": "1b1bd359-2802-4800-b6e1-52d8bc106ce7", "Day": "1242921600", "StartTime": "1242954000", "EndTime": "1242986400", "IsForWork": false }, "LastLeave": { "LeaveName": "调休", "LeaveId": "1b1bd359-2802-4800-b6e1-52d8bc106ce7", "Day": "1242921600", "StartTime": "1242954000", "EndTime": "1242986400", "IsForWork": false }, "IsWholeDay": true }, "DayInfo": { "Date": "1242921600", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1242921600, "AttendanceType": "offDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243008000, "AttendanceType": "onDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": { "Date": "1243008000", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1243008000", "NeedToWork": false, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": true} }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243008000, "AttendanceType": "offDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "496a6afe-40f3-4c08-bc4c-558e2cec5c59", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243094400, "AttendanceType": "onDuty", "ActionTime": 1243142924, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": { "Date": "1243094400", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1243094400", "NeedToWork": false, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": true} }, { "Id": "75f92645-99a3-49e4-8dfb-eef18c65d7fb", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243094400, "AttendanceType": "offDuty", "ActionTime": 1243155859, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "6c913415-0792-447a-ba1a-ca7484b95e2c", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243180800, "AttendanceType": "onDuty", "ActionTime": 1243213297, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1243180800", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1243180800", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "ab22dc20-3d0b-4265-805d-ae2465e423d9", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243180800, "AttendanceType": "offDuty", "ActionTime": 1243248352, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "bd082d5a-63eb-4f56-bb30-e2380b60153c", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243267200, "AttendanceType": "onDuty", "ActionTime": 1243299610, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1243267200", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1243267200", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "bf2a04a0-e344-40f5-923f-f978a1e90a15", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243267200, "AttendanceType": "offDuty", "ActionTime": 1243342845, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "263e05d1-c8b3-49f1-96e4-0ac764a03929", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243353600, "AttendanceType": "onDuty", "ActionTime": 1243385695, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": { "Date": "1243353600", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1243353600", "NeedToWork": true, "HolidayInfo": null, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "716aa443-c7e4-4877-bce9-267639972651", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243353600, "AttendanceType": "offDuty", "ActionTime": 1243419694, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": true, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243440000, "AttendanceType": "onDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": { "Date": "1243440000", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1243440000", "NeedToWork": false, "HolidayInfo": { "Id": "2ff16ff7-c522-4101-9542-b52011baabf2", "Name": "端午节", "Year": 2009, "StartDate": "1243440000", "EndDate": "1243612800", "Remark": null }, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243440000, "AttendanceType": "offDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243526400, "AttendanceType": "onDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": { "Date": "1243526400", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1243526400", "NeedToWork": false, "HolidayInfo": { "Id": "2ff16ff7-c522-4101-9542-b52011baabf2", "Name": "端午节", "Year": 2009, "StartDate": "1243440000", "EndDate": "1243612800", "Remark": null }, "ExtraShiftInfo": null, "IsWeekEnd": false} }, { "Id": "00000000-0000-0000-0000-000000000000", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243526400, "AttendanceType": "offDuty", "ActionTime": null, "Explanation": null, "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": null, "DayInfo": null }, { "Id": "0741a158-19ba-42e7-93c9-efd1b599191d", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243612800, "AttendanceType": "onDuty", "ActionTime": 1243639871, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": { "Date": "1243612800", "Leaves": [], "FirstLeave": null, "LastLeave": null, "IsWholeDay": false }, "DayInfo": { "Date": "1243612800", "NeedToWork": false, "HolidayInfo": { "Id": "2ff16ff7-c522-4101-9542-b52011baabf2", "Name": "端午节", "Year": 2009, "StartDate": "1243440000", "EndDate": "1243612800", "Remark": null }, "ExtraShiftInfo": null, "IsWeekEnd": true} }, { "Id": "23dc544a-2d23-4fd6-9c31-15c1851786d5", "User": { "Id": "19f1c421-280f-4935-9980-e469175461c2", "Name": "龚伟", "UserName": "gw", "Dept": { "Id": "b263f38e-016e-4de8-86b2-74ccf17638ad", "DeptName": "施工图部", "GroupId": "0ab7cdfd-8b60-464a-97a3-6efd7d24a420"} }, "Date": 1243612800, "AttendanceType": "offDuty", "ActionTime": 1243673064, "Explanation": "", "IsAbnormalAttendance": false, "IsNeedToWork": false, "DayLeaveInfo": null, "DayInfo": null}]
        };

        var mock_isHasPermisson = true;

        var mockEzAccessor = {
            'doUpdateAttendanceList': function () {
                bindAttendanceList(mock_json.AttendanceInfoList);
            },

            'getCurrentUser': function () {
                return mock_currentUser;
            },
            'getDeptList': function () {
                return mock_deptList;
            },
            'getIsHasPermisson': function () {
                return mock_isHasPermisson;
            },
            'getBasicInfo': function () {
                g_Var['startYear'] = 2009;
                g_Var['targetTime'] = Date.fromEpoch(mock_currentTime["TargetTime"]);
            }

        };
        EzAccessor = mockEzAccessor;
    } else {
        var realEzAccessor = {
            'doUpdateAttendanceList': function (year, month) {
                $(document).ajaxBusy('begin');
                //与服务器交互
                $.getJSON(
                  URL_PERSONAL_ATTENDANCE_LIST_PER_MONTH,
                  { 'currentMonth': month, 'currentYear': year, "userId": g_Var['currentUserId'] },
                    function (e) {
                        bindAttendanceList(e);
                        $(document).ajaxBusy('end');
                    });
            },
            'getCurrentUser': function () {
                return <%= ViewData["CurrentUser"] %>;
            },

            'getDeptList': function () {
                 return <%= ViewData["CurrentDeptList"] %>;
            },
            'getIsHasPermisson': function () {
                return <%= ViewData["IsHasPermisson"] %>;
            },
            'getCurrentTime': function () {
                return <%= ViewData["CurrentTime"] %>;
            },
            'getBasicInfo': function () {
                g_Var['startYear'] = <%= ViewData["StartYear"] %>;
                g_Var['targetTime'] = Date.fromEpoch(<%= ViewData["TargetTime"] %>);
            }
        };
        EzAccessor = realEzAccessor;
    }



    ///bindMonthList
    function bindMonthList() {
        EzAccessor.getBasicInfo();

        var currentMonth = g_Var.targetTime.getMonth() + 1;
        var monthDownList = getMonthList();
        ///部门下拉菜单
        $("#cmbMonthList")
              .comboxBinding(monthDownList, 'text', 'value')
              .val(currentMonth)
              .change(function () {
                  updateTitleInfo();

                  ///更新假期数据
                  updateAttendanceList();
              }
        );

    }

    ///bindYearList
    function bindYearList() {
        EzAccessor.getBasicInfo();

        var currentYear = g_Var.targetTime.getFullYear();
        var yearDownList = getYearList();
        ///部门下拉菜单
        $("#cmbYearList")
              .comboxBinding(yearDownList, 'text', 'value')
              .val(currentYear)
              .change(function () {
                  updateTitleInfo();

                  ///更新假期数据
                  updateAttendanceList();
              });
    }

    ///get yearList
    function getYearList() {
        var yearList = [];
        EzAccessor.getBasicInfo();
        var currentYear = g_Var['targetTime'].getFullYear();

        for (var i = g_Var['startYear']; i <= currentYear; i++) {
            yearList.push({ "text": i,
                "value": i
            });
        }
        return yearList;
    }

    ///get monthList
    function getMonthList() {
        var monthList = [];
        for (var i = 1; i <= 12; i++) {
            monthList.push({ "text": i,
                "value": i
            });
        }
        return monthList;
    }




    ///updateTitleInfo
    function updateTitleInfo() {
        var currentMember = $('#memberSelector').memberSelector("getMember");

        var title = currentMember.Name + "考勤信息";
        var dateTitle = $("#cmbYearList").find("option:selected").text()
                        + "年"
                        + " "
                        + $("#cmbMonthList").find("option:selected").text()
                        + "月";


        $('#cmbTitleInfo').html(title);
        $('#cmbDateTitleInfo').html(dateTitle);
    }





    function isFutureDate(year, month) {
        var isFuture = false;
        var time = Date.fromEpoch(EzAccessor.getCurrentTime());
        var targetTimeToEpoch = new Date(
                time.getFullYear(),
                time.getMonth() + 1,
                0,
                0,
                0,
                0

            ).toEpoch();

        var dateToEpoch = new Date(
                year,
                month,
                0,
                0,
                0,
                0
            ).toEpoch();

        if (targetTimeToEpoch < dateToEpoch) {
            isFuture = true;
        }

        return isFuture;
    }


    ///updateAttendanceList
    function updateAttendanceList() {
        var month = $('#cmbMonthList').val();
        var year = $('#cmbYearList').val();

        var isFuture = isFutureDate(year, month);

        if (!isFuture) {
            $('#tblNoFuture').hide();
            $('#divAttendanceListPerMonth').show();

            EzAccessor.doUpdateAttendanceList(year, month);

        }
        else {
            $('#tblNoFuture').show();
            bindAttendanceList();
            $('#divAttendanceListPerMonth').hide();
        }
    }



    ///bindAttendanceList
    function bindAttendanceList(personalAttendanceJson) {

        ///bindAttendanceList
        var data = DataConverterForDataTable.convertData(personalAttendanceJson, convertor);
        data.bPaginate = false;
        data.bRetrieve = true;
        data.bFilter = false;
        data.bSort = false;
        data.bInfo = false;

        var isNewDay = true;
        var currentDayText, currDayTD, currDateTD, currInfoTD;
        var colorTbl = ['#FFFFFF', '#E2E4FF', '#DDFFBF'];
        var i = 0;


        data.fnRowCallback = function (nRow, aData, iDisplayIndex, iDisplayIndexFull) {
            // 按照 天数 分割
            if (iDisplayIndex == 0) {
                isNewDay = true
                i = 0;
                currentDayText = aData[2];
            } else if (aData[2] != currentDayText) {
                isNewDay = true;
            }

            // 绘制背景颜色
            if (isNewDay) {
                i = (i + 1) % 2;
            }
            $(nRow).css({ 'background': colorTbl[i] });
            currentDayText = aData[2];

            if (aData[0] == "false") {
                $(nRow).css({ 'background': colorTbl[2] });
            }
            $($('td', nRow)[0]).remove()
            return nRow;
        };
        data.fnHeaderCallback = function (nHead, aasData, iStart, iEnd, aiDisplay) {
            // 隐藏第一列
            $($('th', nHead)[0]).remove();
        }
        $('#divAttendanceListPerMonth').empty();
        var tblAttendanceListPerMonth = $('<table id="tblAttendanceListPerMonth" class="tbl"/>')
          .appendTo('#divAttendanceListPerMonth')
        var oTable = $('#tblAttendanceListPerMonth').dataTable(data);
       
        var dayColumnHead = $('#tblAttendanceListPerMonth thead tr th')[0];
        $(dayColumnHead).css({
            'width': '40px'
        });
        var dateColumnHead = $('#tblAttendanceListPerMonth thead tr th')[1];
        $(dateColumnHead).css({
            'width': '70px'
        });

        var infoColumnHead = $('#tblAttendanceListPerMonth thead tr th')[2];
        $(infoColumnHead).css({
            'width': '240px'
        })

        //设置tr的css
        var setTRCss = function (tr, color , mouseStatus){
            $(tr).css({
                "background-color": color,
                "cursor" : mouseStatus,
            });    
        };

        $('#tblAttendanceListPerMonth tbody tr').each( function () {
            var backgroundColor = $(this).css('background-color');
                $(this).hover(function() {
                    var _self = $(this);
                    setTRCss(_self, '#eee', 'pointer');
                 }, function() {
                    var _self = $(this);
                    setTRCss(_self, backgroundColor, 'default');
            })
           
            
        });

        $('#tblAttendanceListPerMonth tbody tr').each( function () {
            $(this).click(function() {
                var _self = $(this);

                var isHasPermisson = EzAccessor.getIsHasPermisson();
                var timeDom = $(this).find('td')[1];
                var timeStr = $(timeDom).html();
                var time = timeStr.toDateTime().toEpoch(); 

                if(isHasPermisson){
                    //HR
                   var targetUserId = $('#memberSelector').memberSelector("getMember").Id;
                    window.location.href = '/Attendance/ModifyAttendanceInfoPerDay?time=' + time + '&userId=' + targetUserId;
                }
            });
        });

    }


    //处理下拉菜单是否可操作
    function setSelectorAttr(bool) {
        //下拉菜单dissable
        $('#cmbMonthList').attr("disabled", bool);
        $('#cmbYearList').attr("disabled", bool);
        $('.cmbMemberList').attr("disabled", bool);
        $('.cmbDepartmentList').attr("disabled", bool);
    }




    function initPage() {
        EzTipsManager.addTipBox('#tip_Choose', 'tipChoose');
        EzTipsManager.addTipBox('#tip_Remind', 'tipRemind');
       
        EzTipsManager.showTipBox('tipRemind');
      
        bindMonthList();
        bindYearList();

        var currentUser = EzAccessor.getCurrentUser();
        var deptList = EzAccessor.getDeptList();
        g_Var.isHasPermisson = EzAccessor.getIsHasPermisson();

        $('#memberSelector').memberSelector({
            deptList: deptList,
            currentUser: currentUser,
            memberChanged: function (event, id) {
                g_Var['currentUserId'] = id;

                //下拉菜单dissable
                setSelectorAttr(true);
                //缓冲数据加载
                bindAttendanceList(null);
                ///更新标题
                updateTitleInfo();
                ///更新假期数据
                updateAttendanceList();

                //下拉菜单enabele
                setSelectorAttr(false);

            }

        });

        if (g_Var.isHasPermisson) {
            EzTipsManager.showTipBox('tipChoose');

        }

    }

    function initPageEvent() {

    }
    $(function () {

        initPage();
        initPageEvent();
    });
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="PageHead" runat="server">
    <%
        Html.RenderPartial("_sayHello"); %>
    <div id="status-bar"><% Html.RenderPartial("_navigateTo"); %></div>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="PageContent" runat="server">
    <div id="page-head">
        <div>
            <img src="../../Content/icons/attendance_perMonth.png" style="width: 48px; height: 48px;"
                alt="perMonth" />
            <span id="cmbTitleInfo"></span>
            <div style="display: inline-block;">
                <select id="cmbYearList">
                </select>
                <span>年</span>
                <select id="cmbMonthList">
                </select>
                <span>月</span>
            </div>
        </div>
    </div>
    <div id="page-body">
        <span id="cmbDateTitleInfo" style="font-weight: bold;"></span>
        <hr />
        <div id="tblNoFuture" style="display: none;">
            <%Html.RenderPartial("_noFutureDisplayInfo"); %>
        </div>
        <div class="tableContainer" id="divAttendanceListPerMonth">
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="PageShortcut" runat="server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="PageFoot" runat="server">
    <div id="tip_Choose" style="display: none;">
        <h1>
            选择员工:</h1>
        <p id="memberSelector" class="indent">
        </p>
    </div>
    <div id="tip_Remind" style="display: none;">
        <h1>
            小贴士:</h1>
        <p class="indent">
        </p>
    </div>
</asp:Content>
